<template>
  <div class="consulting">
    <div class="consultTitle">
      <h1>请选择咨询分类</h1>
    </div>
    <div class="consultList">
      <div class="consultNav" v-for="item of shoplist" :key="item.id" @click="toconsultlist(item.id)">
        <i class="cuIcon-service lg text-gray icon"></i>
        <h3>{{item.CateName}}</h3>
      </div>
<!--      <router-link to="" class="consultNav">-->
<!--        <i class="cuIcon-creative lg text-gray icon"></i>-->
<!--        <h3>分类名称2</h3>-->
<!--      </router-link>-->
<!--      <router-link to=""  class="consultNav">-->
<!--        <i class="cuIcon-paint lg text-gray icon"></i>-->
<!--        <h3>分类名称3</h3>-->
<!--      </router-link>-->
      <router-link to="/consultFrom" class="consBtn">
        <i class="cuIcon-add lg text-gray icon"></i>
        <span>快速提问</span>
    </router-link>
    </div>
    <div class="foot">
      <tabar :tabbarindex="tabbarindex" />
    </div>
  </div>
</template>

<script>
import tabar from '@/components/nav'
import { getshopList } from '@/api/index'
export default {
  name: 'consulting',
  data () {
    return {
      tabbarindex: 2,
      shoplist: []
    }
  },
  components: {
    tabar
  },
  created () {
    this.getshopList()
  },
  methods: {
    getshopList () {
      getshopList().then(res => {
        this.shoplist = res.data
      })
    },
    toconsultlist (e) {
      this.$router.push({name: 'myconsult', params: {id: e}})
    }
  }
}
</script>

<style scoped>
  .consultTitle{
    background-color: #5290FF;
    color: #fff;
    font-weight: 600;
    padding: .3rem;
    font-size: .32rem;
    min-height: 2rem;
  }
  .consultTitle h1{
    font-size: .32rem;
  }
  .consultNav .icon{
    color: #fff;
    font-size: .6rem;
    margin-right: .2rem;
    font-weight: 400;
  }
  .consultNav{
    background: pink;
    padding: .8rem;
    border-radius: 10px;
    margin-bottom: .3rem;
    font-size: .4rem;
    font-weight: 600;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    color: #fff;
  }
  .consultList{
    padding: .3rem;
    margin-top: -1.2rem;
  }
  .consultList .consultNav:nth-child(2){
    background: #06BEBE;
  }
  .consultList .consultNav:nth-child(3){
    background: #2871FF;
  }
  .consultList .consultNav:nth-child(4){
    background: #F4A439;
  }
  .consultList .consultNav:nth-child(5){
    background: cyan;
  }
  .consBtn{
    background: #E37713;
    color: #fff;
    width: 6rem;
    height: 1.7rem;
    line-height: 1.7rem;
    text-align: center;
    margin:.6rem auto;
    border-radius: 10px;
    font-size: .32rem;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
  }
  .consBtn .icon{
    background: #fff;
    border-radius: .1rem;
    padding: .1rem;
    color: #E37713;
    font-weight: bold;
    font-size: .6rem;
    margin-right: .2rem;
    line-height: .6rem;
    height: .6rem;
  }
</style>
